﻿// Type: System.Data.Objects.DataClasses.EntityObject
// Assembly: System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.Entity.dll

using System;
using System.ComponentModel;
using System.Data;
using System.Runtime;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace System.Data.Objects.DataClasses
{
    /// <summary>
    /// Base class for entity types that are generated by the Entity Data Model tools.
    /// </summary>
    [DataContract(IsReference = true)]
    [Serializable]
    public abstract class EntityObject : StructuralObject, IEntityWithKey, IEntityWithChangeTracker, IEntityWithRelationships
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="T:System.Data.Objects.DataClasses.EntityObject"/> class.
        /// </summary>
        protected EntityObject();

        /// <summary>
        /// Specifies the instance of <see cref="T:System.Data.Objects.DataClasses.IEntityChangeTracker"/> that is used to report property changes.
        /// </summary>
        /// <param name="changeTracker">Reference to the change tracker that is used to report property changes.</param>
        void IEntityWithChangeTracker.SetChangeTracker(IEntityChangeTracker changeTracker);

        /// <summary>
        /// Notifies the change tracker that a property change is pending.
        /// </summary>
        /// <param name="property">The name of the changing property.</param><exception cref="T:System.ArgumentNullException"><paramref name="property"/> is null.</exception>
        protected override sealed void ReportPropertyChanging(string property);

        /// <summary>
        /// Notifies the change tracker that a property has changed.
        /// </summary>
        /// <param name="property">The name of the changed property.</param><exception cref="T:System.ArgumentNullException"><paramref name="property"/> is null.</exception>
        protected override sealed void ReportPropertyChanged(string property);

        /// <summary>
        /// Gets the entity state of the object.
        /// </summary>
        /// 
        /// <returns>
        /// The <see cref="T:System.Data.EntityState"/> of this object.
        /// </returns>
        [XmlIgnore]
        [Browsable(false)]
        public EntityState EntityState { get; }

        /// <summary>
        /// Gets or sets the key for this object.
        /// </summary>
        /// 
        /// <returns>
        /// The <see cref="T:System.Data.EntityKey"/> for this object.
        /// </returns>
        [DataMember]
        [Browsable(false)]
        public EntityKey EntityKey { [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        get; set; }

        /// <summary>
        /// Gets the relationship manager used by this object.
        /// </summary>
        /// 
        /// <returns>
        /// The <see cref="T:System.Data.Objects.DataClasses.RelationshipManager"/> used by this object.
        /// </returns>
        RelationshipManager IEntityWithRelationships.RelationshipManager { get; }
    }
}
